//
//  DrawingInfo.m
//  Drawer
//
//  Created by Adam Cue on 1/24/11.
//  Copyright Adam Cue 2011.
//
//  This program is licensed and distributed under the terms of the GNU General Public License.  
//	The text for the license can be found in the license.txt file in this project.
//

#import "DrawingInfo.h"


@implementation DrawingInfo

@synthesize location;
@synthesize color = _color;
@synthesize width;

- (id)initWithCoder:(NSCoder *)aDecoder {
	if((self = [super init])){
		self.location = CGPointMake([aDecoder decodeFloatForKey:@"xCoord"], [aDecoder decodeFloatForKey:@"yCoord"]);
		self.color = [aDecoder decodeObjectForKey:@"color"];
		self.width = [aDecoder decodeFloatForKey:@"width"];
	}
	return self;
}

- (void)encodeWithCoder:(NSCoder *)aCoder {
	[aCoder encodeFloat:location.x forKey:@"xCoord"];
	[aCoder encodeFloat:location.y forKey:@"yCoord"];
	[aCoder encodeObject:self.color forKey:@"color"];
	[aCoder encodeFloat:width forKey:@"width"];
}

- (id)initWithLocation:(CGPoint)selectedLocation color:(UIColor *)selectedColor width:(float)selectedWidth {
	if((self = [super init])){
		self.location = selectedLocation;
		self.color = selectedColor;
		self.width = selectedWidth;
	}
	return self;
}

- (void)dealloc {
   self.color = nil;
   
   [super dealloc];
}

@end
